package astar;

import domain.Game.action;

public class BfsNode {
	private int _row;
	private int _column;
	private action _pre;
	private BfsNode _preNode;
	private BfsNode _up;
	private BfsNode _right;
	private BfsNode _down;
	private BfsNode _left;
	private boolean hasFlag;
	private String color;

	
	public BfsNode(int row, int column){
		this._row=row;
		this._column=column;
		this.hasFlag=false;
		this._pre=null;
		this._preNode=null;
		this.color="white";//white by default constructor
	}
	
	public int get_column() {
		return _column;
	}
	public int get_row() {
		return _row;
	}

	public void setUp(BfsNode up) {
		 this._up=up;
	}
	public BfsNode getUp() {
		return _up;
	}
	public void setRight(BfsNode _right) {
		this._right = _right;
	}
	public BfsNode getRight() {
		return _right;
	}
	public void setDown(BfsNode _down) {
		this._down = _down;
	}
	public BfsNode getDown() {
		return _down;
	}
	public void setLeft(BfsNode _left) {
		this._left = _left;
	}
	public BfsNode getLeft() {
		return _left;
	}
	
	public void setPre(action _pre) {
		this._pre = _pre;
	}
	
	public action getPreDirection(){
		return this._pre;
	}
	public BfsNode getPreNode() {
		return _preNode;
	}
	
	public void setPreNode(BfsNode node) {
		_preNode = node;
	}
	
	public boolean hasFlag(){
		return this.hasFlag;
	}
	
	public void setFalgToTrue(){
		this.hasFlag=true; 
	}
	public String getColor(){
		return this.color;
	}
	
	public void setColorWhite(){
		this.color="white";
	}
	public void setColorGray(){
		this.color="gray";
	}
	
	public void setColorBlack(){
		this.color="black";
	}

	public boolean isWhite() {
		// TODO Auto-generated method stub
		return this.color.equals(("white"));
	}
	public boolean isGray() {
		// TODO Auto-generated method stub
		return this.color.equals(("gray"));
	}
	public boolean isBlack() {
		// TODO Auto-generated method stub
		return this.color.equals(("black"));
	}
	public String toString(){
		return "Row: "+_row+"Col: "+_column+"\n has pre: "+(_pre!=null);
	}
	

}
